﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AiXiu.Common;
using AiXiu.Model;
using AiXiu.BLL;

namespace AiXiu.WebSite
{
    public partial class Personal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TBUsers user = IdentityManager.ReadUser();
                txtNickName.Text = user.NickName ?? "用户" + user.Id;
                txtHobby.Text = user.Hobby ?? "未添加";
                txtBirthday.Text = user.Birthday.HasValue ? user.Birthday.Value.ToString("yyyy-MM-dd") : "未设置";
                txtAddress.Text = user.Address ?? "未知地";
                imgUserAvatar.ImageUrl = user.Avatar ?? "imgs/avatar.jpg";
            }
        }
    }
}